Events

  • 1. Note

    A JavaScript event is a specific action that occurs within a web page or application, such as clicking on an element, moving the mouse, pressing a key, or loading a page.

    1. Mouse events:
    Event PerformedEvent HandlerDescription
    clickonclickWhen mouse click on an element
    mouseoveronmouseoverWhen the cursor of the mouse comes over the element
    mouseoutonmouseoutWhen the cursor of the mouse leaves an element
    mousedownonmousedownWhen the mouse button is pressed over the element
    mouseuponmouseupWhen the mouse button is released over the element
    mousemoveonmousemoveWhen the mouse movement takes place.
    2. Keyboard events:
    Event PerformedEvent HandlerDescription
    Keydown & Keyuponkeydown & onkeyupWhen the user press and then release the key
    3. Form events:
    Event PerformedEvent HandlerDescription
    focusonfocusWhen the user focuses on an element
    submitonsubmitWhen the user submits the form
    bluronblurWhen the focus is away from a form element
    changeonchangeWhen the user modifies or changes the value of a form element
    4. Window/Document events
    Event PerformedEvent HandlerDescription
    loadonloadWhen the browser finishes the loading of the page
    unloadonunloadWhen the visitor leaves the current webpage, the browser unloads it
    resizeonresizeWhen the visitor resizes the window of the browser
    resetonresetWhen the window size is resized
    scrollonscrollWhen the visitor scrolls a scrollable area